I've noticed a lot more contamination of grain and seed type food products in the stores lately -- I don't know if this is related to poor sanitation or poor vigilance on the part of food processors and vendors, and/or is related to changes in the types of pesticides the EPA and FDA allow to control these insects, or perhaps these types of products just don't have the turnover they once did, because most people seem to buy processed, ready to eat foods instead of cooking from scratch.
At one of my local grocery stores, the bulk food aisle is so infested with Indian meal moths that I see them flying all over every time I go down that row. I can't believe that the store management isn't aware of this problem -- it's been like that for at least two years. Needless to say, I don't buy anything from that row (but, I have to go down there, though, the other side of the aisle has canned soups and canned tuna that I buy regularly). This is a large, "supercenter" store in a suburban area.
I've also noticed a lot of various weevils and beetles in flour and grain products.
I'm not the type to get overly grossed out about this -- for most of human history, we've probably been eating "buggy" grains and legumes more often than not, and our ancestors survived. However, I try to be really vigilant about keeping them out of the house -- I bought a bad bag of dog biscuits once, and fought the Indian meal moths in my kitchen for several months.
If you do get them, the best way to get rid of them is to go through your pantry, and throw out everything which is contaminated, being sure to check even things you wouldn't necessarily think to check, like spices, and then HEAT TREAT the things you are keeping, just to be safe, in a 225 degree oven for about half an hour, to kill any little larvae or eggs you might have missed. I used to think that sealing things tightly would help, but I found that the little buggers would chew through any container except glass or metal, and could get into and under lids unless they were extremely tight fitting.