Hey,
Sorry to hear that man. I had this happen before when I used miracle grow organic soil. I fought a gnat problem from day 7ish until harvest. I used every method there is, fly traps, hydrogen peroxide- dilluted and full strength, I sprayed gnats and fungus directly with pure hydrogen peroxide and they did nothing but squirm (for the worms) and fly away, I used neem oil, I tried starving the plants & gnats of water, cleaned the floors, etc etc.
Then I promised myself I'd never use that shit soil again. 2 years later I said hey I'll give the cheap soil a shot again and got the miracle grow organic. Around day 10 I had gnats. It sucked because there were a bunch of seedlings. Anyway, I threw everything in the trash, washed my pots with a water/bleech mix and also mopped the floors with the same stuff. I left the lights on for a week to dry up the area and fry anything that might remain. THEN I went and got the $20 bag of soil from the grow shop and never had that problem again.
My advice, toss everything and start over. You'll lose a few weeks and that sucks but you'll be much better off. UNLESS you're willing to fight the fight to the end and dont mind dead gnats stuck to your buds because that my friend is exactly what happens... not to mention the larva will start eating the roots when there is no more organic matter for them to eat.