Are U talking about using TV code like SONY protocol or irDA to do it?
For irDA, there is a application note available from Microchip at www.microchip.com, #ADN006. This article is exactly what you want.
If you want to makw the code useful for home appliance using SONY protocol, or RC5, ... You may check some sort of PIC IR interfacing projects generating TV codes. For the PDA side, you may use commercial software such as Omni-Remote to decode the IR pulses.