Springtails and pillbugs are quite easy to rear in a properly maintained terrarium, I've done so myself for more than a year. My orchid mantis is not particularly interested in either though. When he was a nymph, he never touched springtails but did eat half a pillbug once. I've noticed that he roams around the lower regions of my vivarium regularly, where there's quite a few pillbugs, but I've never seen him eat one.
Fruit flies and house flies are a different matter. If you put medium into the terrarium, you can probably rear fruit flies that way. But you risk having a LOT of fruit flies that way. House flies are a big no-no. If you put sufficient animal protein to maintain the larvae into a hot and humid terrarium, the stench would be unbearable.
I think that rearing any significant number of prey animals in a terrarium will be difficult at best. Springtails and pillbugs are useful in their own right though.