Look into the Joystick class of WPILib. It provides methods to get axes and buttons. You can see the following methods available in Joystick.h
Code:
virtual bool GetTrigger(JoystickHand hand = kRightHand);
virtual bool GetTop(JoystickHand hand = kRightHand);
virtual bool GetBumper(JoystickHand hand = kRightHand);
virtual bool GetButton(ButtonType button);
bool GetRawButton(UINT32 button);
Hope that puts you on the right track.