For e.g
FROM ZIP: 98010
TO ZIP: 98011
just issue this HTTP Request:
http://maps.google.com/maps?saddr=98010&daddr=98011&output=html&oi=nojs
Then parse the response for a div
with class=dditd
and id=dditd
and from this div you can extract all the information needed (distance, traveltime, traveltime in traffic (only sometimes given). This could be done via RegEx or XPath or whatever you want.
Once you got the information you must still transform the "textual representation" (e.g. 50mins / 1hour 12 mins / 1day 1hour / ...) into a number if needed for a e.g. DB-field.
Sample what the div looks like for the above query.
<div class=dditd id=dditd>
<div>
<b>38.1 mi</b>
– about
<b>53 mins</b>
<span class=traffictime>
(up to 1 hour 30 mins in traffic)
</span>
</div>
</div>
But keep in mind that the given times are not really accurate as a ZIP code can be a rather large geographic area and I don't know from which point to which google then really measures the time.
So the times given could be off a varying amount depending what the real starting and destination points are.