When you connect the Raspberry Pi with Raspbmc (or OpenELEC or probably any Kodi distribution) to a CEC enabled TV like my Samsung UE40ES6710, it is possible to control it directly with the TV remote without the need for another remote and the quest to find a working IR receiver. Sadly some buttons on the remote were not mapped in a useful way with my TV. For example the exit button quits all menus, while the return button closes only the current one. Those two were switched while using Raspbmc, which is quite confusing and annoying.
You cannot map all keys, because the TV keeps control of some of the keys like volume control or switching source. I put all the keys that I might want to change (and that can be changed) into my config file and set them up or deactivated them. (The red button was always trying to load the PVR addon, which I don’t use at the moment.) The config can be found in ~/.xbmc/userdata/keymaps/remote.xml, which you usually have to create manually. It overwrites the default config in ~/.xbmc-current/xbmc-bin/share/xbmc/system/keymaps/remote.xml. You can check out the default config for inspiration, but you should only add your changes to ~/.xbmc/userdata/keymaps/remote.xml since they might be overwritten otherwise. There is also a list of actions you can use on the XBMC-wiki.
This is how my config looks like at the moment:
I tried to emulate my TVs return/exit behavior with opening the shutdown menu on exit. The important context menu action is on the yellow key (since it is labeled with „C“ on my remote) and I put the info action next to it on the blue button. I also switched some other stuff around, but you don’t need it really. The important buttons you need (which mostly where mapped in the default setting) are cursor keys, ok, back, play/pause/stop and the context menu. Then you should be able to control your XBMC very well, everything else are shortcuts like the info button or the button to toggle if you saw a video already.