Carpenter bees rarely attack painted or varnished wood. While natural wood may be attractive, if there is a problem with carpenter bees, you should consider applying a finish to the wood.
These bees often cause problems on structures by boring into the surface of the wood that is the back face of the trim under the eaves, as this surface is usually not painted. If problems do arise, use a small amount of insecticide that is labeled for bees and wasps. This can be dust, wettable powders, microencapsulated products, or aerosols. The labeled pesticide should be blown into the nesting holes. This is more safely done with aerosols than with the other formulations. Wait a few days to allow the adult female to become exposed to the pesticide, then plug the holes with plastic wood, putty, or a similar substance.
Preventive sprays applied to wood surfaces are effective only for a short period, meaning that you may have to repeat the application about every two to three weeks. However, once nesting activity has begun in the spring, treating the entrance holes with an insecticidal spray or dust may substantially reduce damage. Products containing carbaryl, cyfluthrin, or resmethrin are suggested in Florida, but please check with your local Extension office for the names of approved insecticides for these bees in your area.
Here's a more detailed reference: Large Carpentar Bees.