An easy and fast way of finding the picked X, Y and Z coordinates could be reading the depth of a pixel, then creating a vector from the appropriate place of the forefront of the view frustum with the length of the depth. The picked X, Y and Z coordinates are where this vector ends.
Hah it's impossible to express such stuff in English :/
Maybe this image can help:
Hah it's impossible to express such stuff in English :/
Maybe this image can help: