LSM303DLHC - Calibration, Pitch, Roll and Tilt Compensated Heading

Magneto works.

If the corrected magnetometer data points do not lie (roughly) on the surface of a sphere centered on the origin, then you applied the Magneto scale matrix and offsets incorrectly.