I've thought about this too, not measuring animals though. Just wanted to mention to try the search term focus stacking, with this you can build up a 3d image of say an insect, and measure depth in mm. As far as size, search google play store apps, there's ruler and angle programs. To do this on a Canon, I was thinking to just take a pic of some reference object like a coin (which is very precise) to calibrate to real sizes.
Also real distances and focal lengths are precisesly measured when doing lens calibrations with the checkboard patterns. You could also measure by two view points and trig. I can't explain right now how to get distances out of a calibration, but some free programs that do lens calibrations give a resulting focal length in pixels as a basis, but knowing the size of the checkerboard some even give mm.