You can find every guide and how to connect to RPi here
Here is the first tutorial on how to use Gyro and Accelerometer.