There have been a few apps that I've picked up that claim to be able to judge the distance from one object to the next, all of which have produced questionable results. The one that I liked the best was Sonar Ruler, but it wasn't very practical to use, and became more of a cool "look what my iPhone can do" app than anything.
DAH-Measure takes the measuring app one step further by measuring distance, angle, and height, all in the same app. The developers don't divulge how they calculate the distance, they just say that Measurements are taken using iPhone's camera, sensors and mathematical equations." Their goal was to make a more practical app that wouldn't have a bunch of bells and whistles bogging it down. It was built to work, and it does fairly well.
After fidgeting with the settings, I got to where the measurement tool worked fairly well, only coming 2 ft. off the actual distance (which was 18 ft.). Height was a bit trickier, with one example coming within a foot or two of the actual target and one not coming very close at all.
One word of warning, in the settings screen you have to determine how high your camera is off the ground. Because I am an American, I switched the setting to imperial, as I like ft. better than meters. Anyways, if you use an accurate distance for "camera height from the ground" (i.e. 35-50 in.), the resulting measurements will come up pretty short. I got a more accurate distance saying that my camera was something closer to 150 in (over 12 ft.!) off the ground, obviously a crazy number. I don't know if this is a glitch or just happened to work in my circumstance, I'm just throwing it out there.
The developers did put out a disclaimer saying that the measurements are more approximate than anything, but once you get the settings right, the results are pretty nifty.