Here's what I think happened. The light was installed first. Then, someone came along and installed the fan, and simply tapped into the wiring at the light. This means that the Fan and the light came on together (Which was common at one time). At some other time, someone who wanted to poop quietly, installed a switch for the fan, and simply interrupted the existing wiring.
The image below, drawn with exceptional care in my high tech electrical drafting software shows in black and grey, what you have. The red line is what you should have. (Electrically speaking - Implementation and Code is a whole different story.) That is, you want to disconnect the black wire running between the light and the switch, and rewire it via a pigtail to the black wire before the dimmer. (HOWEVER!!!! That's a real wiring mess, and it actually shouldn't be done that way -- This is purely an electron flow discussion -- it's a jury-rigged solution)
This is non-trivial, and shouldn't be attempted without knowing what you are doing.
What I would do is turn the power off, and open up the boxes where the light and the fan are installed, and disconnect the fan from the light.
If you are lucky, (and you just might be, given the quality of the wiring!) the cabling is not stapled, and you just might be able to fish it down to the switch box.
If you are even luckier, you'll be able to run a short piece of Romex from the dimmer box to the switch box.
In the dimmer box, you'll wire all three whites into one nut. Green/Copper to ground (if it exists).
Disconnect the hot black (the one that goes into the braided bundle) and wire-nut it to the black in your new romex, and a short (6 in) piece of black that you've salvaged or pulled out of your excess romex (Use the right guage!) This short piece will go back into the dimmer.
What you have (ignore red)

What you want:
