What to do about beetle infestation of wheat products? How do we prevent reinfestation?
Ugh, I feel for you!  Just based on the description, it's probably some type of flour beetle (normally either red flour beetle or confused flour beetle -- but check on wikipedia for pictures).  I'm no exterminator, but I've dealt with infestations of both in my pantry.

The only thing that I've found that works is to go through all food stored in the pantry (including that in sealed packages) and make sure that you throw out anything that is infested.  I'm not sure how you feel about chemicals, but at this point, I bug-bombed the house.

After you're sure that you no longer have an infested food, seal everything in plastic food storage containers.  In theory, that should contain any further infestations to a maximum of one container.

The other thing that I've done is to store as much of my dry goods as possible in the fridge/freezer... so stuff like flour is now stored in a sealed container in the back of the fridge.

My exterminator has said that a lot of times the beetles come in a package from the grocery store (a couple beetles in a box of pasta, for example) and they just overrun/overpopulate as much as they can.