Helle Chasm, thank you for the circuit, what do you exactly mean with "It does not limit the output voltage to 5V." ?
This kind of circuit provides a virtual ground at
half the input voltage.
(Or the point you selected, if you use other resistor values or a potentiometer.)
There are some limits:
The Input voltage must stay within the operational limits of the opamp.
The current is limited by the output stage of the the power opamp, or the transistors if you use a normal opamp.
Say up to 250mA for the examples posted, extending this much more usually does not make too much sense.
So the caveat is that you have to watch the input voltage, or you can easily damage the device you are powering.
Because you need a fixed voltage next step is to add some form of voltage regulation.
Two zener diodes (at least 1W!) in the
output in the have been mentioned. But getting this right is actually a bit more complex.
The simplest solution is to use a pair of linear voltage regulators, 7805 and 7905. They are cheap, about 50ct at the local electronics store for the TO-220 version.
There are of course also many other (and better) linear regulators. But they are not used in abundant quantities and thus usually more expensive and harder to get.