Check Erle-Brain's book in order to obtain more info about this procedure.
This process will require you to place your copter in the positions shown below in sequence. The level position is the most important to get right as this will be the attitude that your controller considers level while flying.
It is important not to move the copter immediately after pressing the key for each step. Check out this video for an example of how to hold the copter.
When you’re ready to perform the calibration, select Calibrate Accel.
The Ground Station will prompt you to place the copter in each calibration position and press any key. Proceed through the required positions.
When you’ve completed the calibration process, the Ground Station will display a message.
You can check this tutorial to know how to do it. Note: the APM is older, but the proccess is the same