Check out this web page for a near infinite amount of information on how IR remote controls work:
And for a snapshot of my work on building the ultimate universal remote with an arduino,
check out:
http://home.comcast.net/~tomhorsley/hardware/arduino/arduino.html