Wiring bathroom fan and light
Please excuse my MS Paint representation, but it should help.


From what I understand, the grounding wires may not be necessary, but if the fixtures have ground wires or grounding terminals, it can only help to connect them. This question explains grounding in some more detail.

One exception is that if the vent is directly over a shower, it might need to be GFCI protected (see this question). This could be done in a variety of ways. You could install a GFCI breaker and run the vent on a dedicated circuit, but that would be annoying if it tripped since you could only reset it at the breaker. You may be able to install a dedicated GFCI outlet in the bathroom and connect the vent and switch to the protected side of that outlet. You can also find combination GFCI outlet/switches that would combine the GFCI outlet and the switch into one unit.