This is how to hook up a DC motor to Arduino for PWM one way control:http://www.tigoe.net/pcomp/code/category/code/picbasic-pro/62
If you also want to be able to control direction you shold use a H bridge circuit, do it like this:http://www.toddholoubek.com/classes/pcomp/hbridge/Hbridgel293.html
As i said in the other thread if you try to drive inductive loads like motors directly from Arduino pins, best case it won't work, worst case, you can kill the Arduino board.
Inductive loads pull a lot of current in generel, and especially just when they start up, usually much more than the max 40mA you can source from any Arduino pin
Optocouplers are no good in this case.