First, Some clarification:
Serial communication is a protocol that uses all (most) of the pins. Some pins are used for synchronising the two communication chips. But the actual data is sent out of ONE DATA PIN, one BIT at a time.
Parallel communication on the other hand is a protocol that uses 8 DATA PINS to simultaneously communicate one BYTE at a time. Printer ports are usually parallel ports.
Depends on OS:
How you send data from a program via either of these ports depends on your operating system.
It's easier on Linux than on Windows.
For Windows, it's a bit more complicated, because Windows puts restrictions on port access in user mode (i.e. by user programs).
For Parallel Port on Windows:
However, for Windows I have successfully driven LEDs off the parallel port using the io.dll
provided here on Geek Hideout. The io.dll package contains a .dll and a .h header file documenting the functions which your C program can use.
For Serial Port on Linux:
See the code from this answer and this Serial HOWTO (for Linux)