(Above): a diagram of connecting the receiver to an Arduino. You can get these HERE.

There are many different manufacturers of IR Receivers and some have different pinouts:
Image courtesy of Alberto Piganti. See: http://www.pighixxx.com/
There is also an easy-to-connect IR Receiver Electronic Brick like this (right). It can be plugged into a Sensor Shield or YourDuinoRobo1 with a 3-pin cable.

CONNECTION NOTE: The IR Remote Receiver Electronic Brick has 3 pins. From left to right they are: (G) Ground, (V) Voltage, (S) Signal. BUT the marking sometimes vary on the little circuit board. In this photo they are marked G-R-Y. The 3-pin cable in the photo has the typical color code: (G) Ground = Black, (V) Voltage = Red, (S) Signal = White.
This brick also comes with the IR Infrared Robot Remote Control Kit which has a remote with arrow buttons for direction etc. (Scroll down for example). It is also in the YourDuino Electronic Brick Set.

IR-REMOTE LIBRARY:

Note: The following library must be installed in your Arduino installation for this to work!

NOTE!! If you have a late version of Arduino with a library IRRobotRemote, it may conflict and you may have to remove that library.
Make sure to delete Arduino_Root/libraries/RobotIRremote. Where Arduino_Root refers to the install directory of Arduino. The library RobotIRremote has similar definitions to IRremote and causes errors.

TYPES OF IR REMOTE CONTROLS

NOTE!! Most handheld remotes are shipped with a small clear plastic piece in the battery compartment that must be removed to activate it. You can usually just pull it out.
There are many different IR remote controls. Some from YourDuino.com are the low-cost IR Infrared Remote Control Kit 2 and also the THIS IR Remote (right) which has directional buttons that would be good for controlling a vehicle etc. Then, there are the typical TV and Stereo Remotes. All of these may have different encoding methods and number of physical buttons, and different codes received when a button is pressed. Below we will give example Software Sketches for a few common IR Remotes.

IRrecvDemo SKETCH:Read codes from almost any IR Remote

If you need to discover the codes received from an unknown IR Remote type, use this Sketch from the IR Remote Control Library Examples first. (You must first install that library - the link is above).

(Copy and paste into a blank Arduino IDE Window), Upload to your Arduino and start the Serial Monitor window:

Below is the IR Remote Control Kit connected to a YourDuinoRobo1 with a 3-pin cable. On the right is the detail of the way the IR Receiver is carefully plugged into Gnd and Vcc on the cable, and the Out pin is insulated with a piece stripped from another wire, the pins are cut off evenly, and Out is routed into the Signal (White) pin of the cable. The software below displays the button that was pressed.

Blinks Pin 13 number of times according to button number. This may be a place to start when writing your own code to take actions depending on the button.

If you use the IRrecvDemo Sketch (above) and count the 21 buttons from left to right and top to bottom, the codes received are these: (NOTE: Receiving "FFFFFFFF" means "repeat" if you hold the button down.)

1

FFA25D

2

FF629D

3

FFE21D

4

FF22DD

5

FF02FD

6

FFC23D

7

FFE01F

8

FFA857

9

FF906F

10

FF6897

11

FF9867

12

FFB04F

13

FF30CF

14

FF18E7

15

FF7A85

16

FF10EF

17

FF38C7

18

FF5AA5

19

FF42BD

20

FF4AB5

21

FF52AD

Example: MAKER Version Electronic Brick Set IR Remote

The IR Remote supplied with this Set looks like this (Others may also be supplied):

This is especially good for remote control of a small robot, using the arrow buttons. Below is an example Software Sketch for this remote. The reported buttons will be Forward, Left, Right, Reverse (for the 4 blue button), OK for the red 'OK' button, 1 to 0 for the white number buttons, and '*' and '#' for the bottom red buttons.

(Copy and paste the Sketch below into a blank Arduino IDE Window), Upload to your Arduino and start the Serial Monitor window. Connect the IR receiver to +5V, Ground and the signal to pin 11. If you have the MAKER Version Electronic Brick Starter Set you can just plug in the supplied IR Receiver Brick with one of the 3-pin cables.