Electricity works on "potential", or actually...the difference in potential. It's really easy once you just get the simple addition and subtraction going. If you hook up to the red (5v) and the ground (0v), you get a 5v supply. If you hook up to the red (5v) and the yellow (12v), you get a 7V supply because it's the difference between the two. And, of course, the yellow and black give you 12v. See the simple math in there?
Take note that 5v may or may not be high enough to buzz your fan for a low setting, and 7v may be prefered. Either way...
To get 7v with a three way switch, you hook the neutral (reference) lead to the yellow. Then one side has the red, and one side has the black. This will have a switch position give you 12v (high), off, and 7v (low). It reads to that middle pole (12vv)as a reference. When you close a pair of contacts, it then supplies the differential. Just pay attention to your internal wiring in the switch.
To get the conventional wiring with 5v low and 12v high, you change two wires around on the switch: