Zdepth pass for Maya
I see many different techniques to do this pass. Here is one used by Alex Alvarez.
1) Switch to maya software, go to render options under the software tab, create an environment fog shader by clicking on the first icon.
2) Switch back to mental ray or whatever you are using.
3) In the attributes of the fog shader, set the color to black and turn off color-based transparencies.
4) Under clipping planes, you could also specify where the object start and end away from camera.
5) Now assign a surface shader with full white color to all the objects in your scene. Set the quality of the render and you are ready to go!
Digital tutors use the camera depth pass in render passes which produces 32bit zdepth data easily.
1) Create a new render layer with the objects, associate the camera depth pass.
2) Make sure frame buffer is 32bit.
3) In the depth pass attributes, you can specify the near and far clip distance if the remap depth values is checked. You are done and ready to throw it into Nuke or something.
The easiest of all I feel, is the luminance depth method. You just need to create a new render layer and use the luminance depth preset. When you batch render it, the zdepth image will display correctly.