Well to find the distance between two points you can use this code:
//x1, y1, z1 - x, y, z coordinates of the first object
//x2, y2, z2 - x, y, z coordinates of the second object
sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2) + pow(z1 - z2, 2));
However, because you want the distance from an object to the surface I think you have 2 viable options:
1. Cast a ray from the first object to the 2nd object using a per poly collision check and get the distance of the final ray. The distance may be conserved in the collision library of your choice, but if it's not you can use the distance formula above with the ray start and end position.
2. Mathematically find the surface (polygon) of the 2nd object that is facing the 1st object and find the center of that polygon. Then use the distance formula from the object to that center. This would definitely be harder to do, especially if you have models with inverted polygons and such.
I would say to use method 1 and use something like Sparky's collision or some other collision library.