Here is a book which looks good on the subject:
http://www.amazon.com/Tantric-Sex-Men-Making-Meditation/dp/1594773114There are many books on this topic and probably also good websites and maybe youtube videos which would explain how to do this. I read a book on this topic years ago which was written by a Chinese herbalist, I can't remember the name of that one though.
It is a beautiful feeling, and when experienced with a partner who is on the same page can lead to incredible heights of spiritual union in sex, with dedicated practice. The "raw creative force" this releases in the body, when practiced in sex or masturbation, could also be called kundalini or prana, and is a powerful energy which can raise awareness.
The sexual taboos against masturbation and sex in general are a shame. While it may diminish a bit of energy momentarily, I think the taboo really stems from condescending puritanism and totalitarian "religious institutions"/governments from the past. I think it was Robert Anton Wilson who said the reason power structures try to control the sex life of people is because it is at the core of where we all come from. It is a nasty trick.
Even if prana is temporarily lost from masturbation, or sadness or being very angry at someone or illness or many other possible things, it will return to the body shortly, and more truly, I think the source of the prana is an infnite well.
I masturbate usually just to help fall asleep lately. Ideally, I would prefer to not to, but I think I've learned to not feel guilty about this. We are spiritual beings in animal bodies, and all life has come from these Universal desires which causes more life and the evolution of all species!
It is most important to first eliminate the guilt and shame I think from these things, and then to try to consciously choose to do what is best for you and/or your partner.