In electronics class we use something called an 'IO-board' which is connected through the serial port. Our teacher has written a script to run it and we can use simple commands to write high/Low out through 8bit.
So we basically use homemade commands like 'getInput()','setDirection()' and 'setOutput()' that does the job.
This is how we do it, and then, as mgb_phys said, we connect the motor etc to a circuit which is controlled by the High/Low from the 8bit.
Hope I was of some help.