The "bees" may have been the small species of yellow jackets, which often feed on feces. If you put manure in your compost, they may have been feeding on that. They will feed on certain fruits, too, but I've never seen them feed on vegetables. In the future, I would suggest that you cover the surface of the pile with 2 or 3 inches of soil, immediately after adding components such as manure. When adding small amounts of fruit, you could just dig down into the pile and bury them.
I'm not sure leaves or water would be sufficient to deter the yellow jackets. I used to have to shoo them out of my big outdoor habitat cages every morning, before I could go in and clean up after the animals. I would spray them directly with the hose, and they'd just come right back.
"Isn't it enough to see that a garden is beautiful without having to believe that there are fairies at the bottom of it too?" - Douglas Adams