I have them once in while also. The flys aren't the problem, but the larvaes that'll eat your roots under the surface. Try using some peeled potato skins on top of the surface, that is what I was told, and it seems work pretty well..
Also, put some(1-2cm) gravel or hydroton on top of the coco, that also helps to keep them from laying those nasty eggs..
Cheers..