Yup. Most of the options that spring to mind are ruled out here as they will one day eat your barbs.
You could always get a few of the smaller, "upper-jaw" Polypterus species. Namely senegalus. Chain pet stores call them dinosaur eels, as they hail from the Jurrassic period. 40g breeders are the perfect grow out tanks for small poly specimens of any species, and a senegalus can potentially live in one for many years. You would need to relocate the barbs when the poly was nearing 5.5-6" though. Finding a mildly larger fish to coexist with your barbs might prove difficult, as most fish eat one another indiscriminately.
Rams aren't going to be as big as you might like, but hey, they're blue, and generally peaceful fish.
Most of the people on this site are more knowledgeable about larger fish. You might try finding a good online dealer, browsing through their stock, and asking your local fish store if they can order the fish you want. I would assume an African butterfly fish would eat your barbs, but that's another interesting choice that could spend all or most of its life in a 40.