Any modern digital camera can do that, usually with a rudimentary video feature as well.
Until recently, any and all of my fly pictures were taken with a fairly old 4.0 MP Kodak C330. It wasn’t the best, but it got the job done. Up that close, it’s autofocus had trouble deciding what to grab.
A few months back, I upgraded to a new Pentax WS80, mostly because it’s waterproof. its macro focus is also much better than the Kodak’s.
For your money, there’s several inexpensive brands on the market, but for another 20-30 you could get an entry-level compact from a great name (read: Canon, Nikon, Sony, etc) that would probably serve you well in a variety of other needs as well.
As you search, the main things you’re looking for is a good macro option (with a fairly low minimum focusing distance) and an adjustable white balance (custom is ideal, but a tungsten & a fluorescent preset are okay too). A shake-reduction feature is nice too, but not absolutely necessary.
More important than the camera, though, is the photographer and his technique.
For quick shots of flies, I’ll just switch to macro focus, set my white balance, and shoot away, but if I want a really nice shot, I’ll use a mini-tripod and use a 2 sec. timer to totally eliminate shake, meaning the camera can use a slower shutter speed without blurring the picture.
TIP: If your autofocus wont seem to grab your fly, back up a bit. 