Composite node/ Viewer node preview not showing
The Z pass outputs a value, measured in Blender units, from each pixel to the camera: if your object is far more than 1 BlenderUnit, the viewer of this output will be totally white, treating every value bigger than 1.0 as 1.0.
I think the best way to use the Z output is inserting a "normalize" node, wich will assign 0.0 to the minimum value and 1.0 to the maximum, scaling all others values accordingly.
You can follow the normalize node with a color ramp, to fine tune the new Z signal.
In my image the color ramp node is used only as "inverter", so 0.0 value becomes "white" and means minimum distance from the camera, and 1.0 values gets black (maximum distance from the camera).
Note that the upper angle of the cube is black.

For a quick udersranding of nodes, use the combination ctrl+shift click on a node to instantly show his output on the viewer.