Squawk 8888,
I have done this before, it is not as easy as it initially appears.
Make sure you use the correct ellipsoid (WGS84 is fairly standard).
The magnetic model of earth, if you want to interpolate between points its fairly easy, writing a complete harmonic model of the magnetic field is not that easy.
If you would like to have a excel spread sheet to verify the results of your bearing distance stuff let me know, I could also email you some delphi code if your feeling lazy !