The black wire is splice to the output on the speed controller and to the black, fan wire at the other end. The red wire is spliced to the output on the dimmer and to the blue, light wire at the other end. The neutral from the source is spliced in the switch box with the white wire, and to the neutral wire on the ceiling fixture at the other end.
Run the cable through the clamp and tighten it down. Splice the cable wires to the fan wires using a pigtail splice and a wire nut. Connect the ground to the grounding terminal in the connection box and the ground wire from the fan, if there is one.
This diagram shows two switches in the same box with two separate 120 volt sources. Three-wire cable is supplying the source for both switches with the black and red wires going to the bottom switch terminals. The black wire from each light is connected to the top terminal of their respective switch. The white and ground wires are spliced to run to each light fixture.
This diagram illustrates wiring a GFCI receptacle and light switch in the same outlet box, a common arrangement in a bathroom with limited space. The hot source is spliced to the LINE terminal on the receptacle and to the bottom terminal on the light switch. The neutral and ground wires are spliced together and run to each device in the circuit.