Render the depth map in grayscale I need to feed in an image processing software an image where the color of a pixel means the model's surface distance from the camera. 100% white would mean the closest distance, black - the furthest. Of course, I'd need to control this min and max distance to find the most appropriate values for every particular 3d model.
If I could get those values in HDR range, that would be much better than just 256 levels.

I noticed there's an option to select Z-Buffer in the channels in render result view, but I am not sure I can get the color levels work as I need.

Please suggest the most appropriate method how to get access to the depth data.
The far and close ranges for the scene can be controlled with the camera far and near clip distances.

The best format for you to export depth information would be on an OpenEXR file. Z infomation would be stored as 32bit linear data, not restricted to the grayscale values form 0 to 1 and not mapped to the 256 values of 8 bit images.