If you look in the examples supplied with the IR Library GitHub - Arduino-IRremote/Arduino-IRremote at 3f70ad2e4c95d88dde93ce2ffa63d316f07390d5 (specifically the IRrecvDemo.ino demo) you will see where it just reads and displays the IR code recieved.
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value, HEX);
irrecv.resume(); // Receive the next value
}
}
All you would need to do is replace the 'Serial.println(results.value, HEX);' with suitable code that act on the specific IR code(s) you want it to.