Treat infestations with an appropriate insecticide. For bumblebees, spray the nest entrance with a "wasp and hornet" aerosol and then close the entrance with a handful of moist soil. Treat at dusk, when the bees have retreated to the nest. Always wear protective clothing to safeguard against stings. The best protection against carpenter bee destruction is to paint -- not merely stain -- all wood surfaces with an oil- or latex-based paint. Pressure-treated wood will also deter nest construction.
Seek immediate medical attention for anyone who is stung and is allergic to wasp or bee stings, or is not allergic but stung around or within the mouth, nose, or throat, as swelling could close airways. Otherwise, take out the stinger: Dislodge it by scraping across it with a credit or playing card. Do not pull the stinger out by gripping it with tweezers or your fingers, as you could force more venom into the wound. After the stinger is removed, wash the area. A paste of baking soda and water can lessen pain. Ice will reduce swelling.