PC Parallel port control

Hi PC Guru's
PC's are seemingly not used a lot to control the real reality. I want to
attempt to use the PC's parallel port to receive signals from switches
and send on/off's to domestic devices such as fans, heaters, lights,
Any Pascal code addressing the Centronics pins would be a great help.