This Kit from kitsrus.com (available
here) uses the parallel port on a PC as a cheap "Data Acquistion"
The interesting bit for the purposes of this thread is that
this document has a discussion of IO via the printer port (addresses, which pins do what, how to read from the port, how to write to it, etc.) . It has BASIC code examples (though they are specific to the particular IO box, if you know a bit about the chips used on the board, you can pretty much follow what is going on).
Good luck.
Joe J.