Magnetometer and gyro fusion

Look at multiwii.com. It is (IMO) the best and simplest arduino-base software for multirotors.