At the risk of getting shot down, I'm going to give you my honest answer...
I've been in this situation. Back in my early 20s I had a very good male friend who I would occasionally sleep with. Only if we were both single though. We were never boyfriend/girlfriend and were both happy with our little arrangement. (I was anyway and I don't remember him complaining!)
We just kind of stopped at some point. He is now in a very happy relationship, and I have my lovely Mr P. We are still friends, at least on FB as we are at opposite ends of the country now.
I think it can work, but there is a huge danger that one person may develop deeper feelings. I think it worked for me as I was just getting over a relationship and really didn't want another one.