I normally use a set of distances from personal observation that I knocked up on speadsheets before Eisenbahnatlas became available. They have not been updated properly for some time and there are quite a few "grey areas" so I normally use the atlas to double check.
There is a downloadable mileage / price calculator on the DB website but it is rather fiddly to use - will post the link later when I can find it!
EDIT:
It is called TPS-Preisauskunft-Software 2010, and can be found
HERE . You need to download the 11.41MB zip file towards the bottom of the page.
When you get it open, you need to click on "Preisaufkunft" in the top left hand corner and enter the start and end points, if doing a long route it is probably best to do in in chunks to make sure that the routeing is correct. The fiddly bit comes in that you need to enter the staions as their official codes as seen in the "Auswahl 2" box on the right, it is easier to look them up in the index to Eisenbahnatlas Deutschland rather than attempt to find them in the list! (There might well be a search function but I can't see one!)