With that said, once we used it to clean everything, we wiped everything down THEN lubricated our weapons with Break Free and later with MILTECH. As for my personal weapons, I will use it sparingly to clean all my guns (followed by MILTECH as a lubricant) and have not found it to be a problem yet.
Wiping off WD-40 would remove most of the WD-40 and whatever residue is left after the light oils evaporate. Going over the surface later with break free would dissolve the remaining WD-40 into a good lubricant.
The MSDS of WD-40 is here.
http://www.wd40company.com/files/pdf/msds-wd494716385.pdf
It has volatile oils, slightly heavier oil, and the secret ingredient : "non hazardous ingredients"
I suspect the non hazardous ingredients contain silicone. The oils evaporate off leaving silicone.
The oils would dissolve powder residue, because "like dissolves like". I have no doubt there are better powder solvents, and one is called "GI Bore Cleaner". Mineral spirits, acetone, are probably better. Any of the surface cleaners used in automotive paint shops are excellent solvents. (They will dissolve the powder residue and your plastic grips!)
I did a rust test with penny nails in salt water. WD-40 did good. But it only provides short term rust protection. It is not going to be as good a lubricant as motor oil. In fact since so few oils are better lubricants than motor oils, lets just say, there are a lot more oils which are better lubricants than WD-40.
If you want a very good, cheap, gun powder solvent, just Google "ed's red" and make that. If you want an excellent, cheap lubricant, use motor oil.