I want to be able to control my robot wirelessly from my pc via xbee modules. So one xbee should be connected to my computer while the other one will be to the arduino on my robot. I've done a lot of research on xbees but Im still very confused. For example I'd like to control it manually using arrow keys and also be able to control other functions on the robot like headlights etc. But frankly I dont know where to start. Can someone give me a brief introduction to how this can be achieved? Thankyou.
You didn't mention what version of the XBee and/or Arduino you intend to use. I'm assuming the XBee series 1 (cheapest) on a Uno (reasonably cheap). In addition to the obvious XBee -> Arduino "breakout" board (that will convert the 5v Uno signals to 3.3v XBee signals and vice versa) - you will also need the USB -> XBee interface (what they call "explorer boards" often).
Option A - write your software on the PC to send serial data out through the PC-XBee to the Uno-XBee, which will then translate your commands into appropriate Arduino-ish pin actions. (see other answer provided)
Option B - more relevant to this site. Forget the PC (except for programming your Uno and XBees). The XBees have a wondrous feature, line passing, utilizing their built in ports and ADC circuitry. As an extreme simplification - a change in voltage at an IO pin on the source XBee will be reflected on the destination XBee(s) pin(s). Directional buttons can then easily be constructed on a PCB/breadboard as a control transmitter, and the corresponding actions programmed into the UNO on the far end that reads these IO signals from its XBee. One fun variation is the ability to get multiple XBees to listen, allow you to build robot swarms that all follow the commands being sent. If this is more to your liking, you can ask a more specific question about line passing on XBees.
First you need to write a program that reads input from the PCs keyboard and sends commands to a serial xbee connection. Then you need software on the robot arduino that reads the commands from the serial connection and does what needs to be done.
The definition of this protocol (the data sent over the serial connection) is entirely up to you. For example an "F" coming from the serial connection could mean that the robot should move forward, "S100" means "set speed to 100", "H1" means "turn on headlights" and so on. You can use linebreak or space to separate different commands.
This tutorial should get you started: http://tutorial.cytron.com.my/2013/01/14/remote-mobile-robot-with-xbee-wifi/