I had this too, really really bad one and somewhat bad another time. I never figured out if they were fruit flies or phorid flies (decomposition flies). I agree that fruit is bad to put in there because of this. The time I had this really bad I could see the larvae and I knew the flies were breeding. What I did to remedy this was first to take the bin outside away from where I normally keep it and bang the bin sharply a few times, let the flies go flying out, then quickly move the bin to another part of the yard and repeat a few times. This gets a lot of the adults out. I then attached rectangular fly trap paper (it's actually all plastic with a glue like stuff on it, attach the fly strips to the inside of the lid as many as will fit
see this:
After this I lowered the humidity of the bin from 80% to about 60% and lowered the bin temp to around 79F. I also didn't feed the roaches for 10 days except for a tiny amount of wet carrots for
hydration after 5 days. I would open and disturb the bin daily to see if there were more flies, if so I would bang the bin in the yard again. This completely knocked out the infestation. I know this sounds extreme but I tried for several months to knock the flies out and they kept coming back because I wasn't getting them all. Please keep in mind that doing this will cost you some roaches and the roaches will likely not breed for a bit after doing this due to the stress and the less than ideal circumstances. Keep an eye on the roaches during this process...if you start to see lots dying you should probably abort or tweak the parameters.