You can get mosquito Dunks, crumbled (well) on top of soil and water in. about a third on top of 5gal. pot, or crumble that into a gal. of water (no chlorine), Molasses and bubble 12-24hr. water soil. Then put play sand (sandbox type) on top of your pots (1/2-3/4") some people rinse it first. Be prepared for some of the sand to work into your soil, especially coco heavy mix. Whew! Then get some of those sticky sheets Mongol is talking about. Someone just the other night was talking about mixing Hydrogen Peroxide in water at 25%, and watering soil with that. Don't know anything more about that (% peroxide solution) so ask around.
I had a horrible time with Gnats last grow. wasn't until I did the described things above (minus Peroxide) and accidentally letting my pots dry WAy out did I get a handle on them! I think they came in either the sphagnum peat or the damn fresh EWC I'd bought for my soil mix. Good luck!!!