Have a look here: www.picbasic.nl
Under Projects you will find this link: The TV-remote RC5/RC6 codes on a LCD

Bare in mind that the code is written in Proton picbasic!
I guess you will have to make some adjustments...

Regards,