Check with customs, both in Costa Rica and the U.S. A lot of insects are restricted due to potential agricultural impact. If Cost Rica protects any species, that would also impact what you can bring back. But short of agriculture and protected species, you have a good chance of getting permits. Next hurdle is making sure the airlines are OK with transporting "bugs". They probably have containment requirements.
And just know that if your permits are in the least bit messed up, you stand a good chance of losing the animals. I had a friend whose bustard feathers from Mongolia were confiscated by U.S. customs for months because the Mongolians forgot to put _one_ stamp (of several) in the correct box.
Neary all insects in Costa Rica are considered protected wildlife as most of them are endemic to any one of CR's national parks... which make up a big part of Costa Rica itself. The USA bans any and all insects coming from Costa Rica INCLUDING soil, dead leaves, insect parts, other inverts and reptiles.
Ask me how I know? First hand experience and a 'first time offense' fine:
YOU CAN BRING NOTHING BACK FROM COSTA RICA LEGALLY !!!
Roaches that - accidently- got into my luggage. Some were very uniquely colored too.
Though they did make me scrub the bottoms of my boots and shoes (which were NOT very dirty at all)...to clean off the 'dirt'.
Long conversations with the officers ensued, and the result is that they are trained to block any/all organic material regardless of your intent or paperwork. If you have actual correct paperwork, they will confiscate the item(s) until they can verify you did not fake the papers....which could be hours, or days. And you may or may not be detained in the process.