Thanks a lot! Your code helped me to figure out that I totally forgot to normalize the scale of my image plane.
Before normalization my image plane was centered around (0,0,500) and the top left corner around (-512, 384, 500) in world space. Without adjustments of the object positions and sizes absolutely nothing could be seen.
Now I used your proposed equation for the focal length f:
Everything works fine by now though I still have a question. When I choose a wide angle for the horizontal field of view, let's say 120°, I see spheres getting oblong at the border of the screen. Is this the so called "fisheye"-effect due to a wide field of view?