I've done this two different ways.
One is just to compare zip codes. There are lots of free zip code databases on the web that also contain lat/long. This would be sufficient if you knew that 99% of the time, your addresses were relatively far apart. No real API necessary. Get the two zips, look up their lat/long, calculate distance.
The other is to find the lat/long of the street address. The last time I set this up for a client was 3-4 years ago and there was no free service. But I did find a cheap one. It's $50 for 20,000 lookups. http://geocoder.us/ Nice API. Very simple to use. Hit once for the 1st address to get the lat/long. Hit a second time for the 2nd address to get the lat/long. You'll have to calculate the difference yourself but that's trivial (algorithms all over the Internet). There might be other, one-stop solutions, but I'm not sure.