"Go on," said Paulo, handing me a fistful of termites, "eat them."
It's a funny business, eating creepy-crawlies. Most of us will happily eat prawns (with their long whiskers and crunchy armour) but draw the line at their terrestrial equivalents, insects. Paulo had no such qualms, and nor did the rest of his tribe, the Bribri, an indigenous people living mainly in the south of Costa Rica. With great expertise, he'd hacked his way into a termite mound, and was scooping up the residents.
This all began when I asked Paulo how he'd survive, were he lost in the forest. It seemed a reasonable question at the time: we were three hours into the forest in the Cahuita national park, on the Caribbean coast close to the Panama border. Despite all the creatures glowing in the shadows – dart frogs and eyelash vipers – it was never much lighter than dusk. As always happens in good Costa Rican forest, I already felt pleasantly lost. We were also hungry. Paulo had found us lots of useful things (including arrowwood trees and a cure for tapeworms) but nothing to eat, and that's when I asked.
My wife, Jayne, hesitated but our seven-year-old daughter, Lucy, was soon picking out the termites and crunching them up like sweets. Paulo looked on with pride. After thousands of years of being largely alone, the Bribri now had visitors sharing their world – and eating their bugs (termites, by the way, taste of wood pulp, flavoured with puddle).
It's not hard to see why, for so long, eastern Costa Rica was overlooked. It didn't have gold (which the Spanish were after) nor the rich volcanic soils of the highlands, which later immigrants sought. And all the coffee was shipped out via the Pacific port of Puntarenas. Only in the 1870s was a railway line hacked through the forest from the capital San José to the Caribbean port of Limón – and that took 20 years to complete, and cost 4,000 lives.
These days, getting to the coast is easy enough. Although the "Jungle Train" has long gone (mostly thanks to an earthquake in 1991), a smart blacktop road now wriggles out of the highlands before plunging into the banana belt below. For hours, we drove through banana plantations, and then banana towns with names like Liverpool and Beverly. For a moment, it all seemed like Africa, except for the huge container parks, like cities without windows.
Then we were bouncing free, along the coast. This road was only built in 1977, and people still come out to stare at the cars. There was plenty of drama: toucans fighting over fruit, or vast pineapple trucks painted like fairground rides. We even spotted a policeman next to a small mountain of bootleg whisky. Until this road arrived, there were no checkpoints between here and Panama, and it seems even the smugglers have taken time to adjust.
Eventually, we crossed into the province of Talamanca. Along this long, sandy, coconut-lined shore, there are few villages. Before the road came, the only people who lived here were the Bribri and a few turtle hunters, who'd made their way over from Jamaica. Caught between the jungle and the rip tides, most people had settled down to a life of ease. It's said that people still enjoyed Shakespeare here, and maypoles, just as they had in old Jamaica.
I enjoyed the little towns along this shore. One was Cahuita (with its national park and the toothsome termites). Another was Cocles, which consisted of a football pitch, a washerwoman, a grocery (selling mostly crisps) and an animal refuge, with owls and monkeys. For a child, the utter weirdness of the fauna was exhilarating, particularly the rays, gliding along the seabed like carpets come to life.
The main town was Puerto Viejo, or Old Port. It was the English who first recognised its charms, and in the 17th century it became a bolthole for pirates. These days things are less hurried, and buildings are made from driftwood. Our favourite restaurant, Koki Beach (kokibeach.blogspot.co.uk) had been built round an almond tree, and once suffered a rare indignity for a designer restaurant, being plundered by monkeys.
But, for the most part, it didn't feel as if things happened suddenly here. Electricity only arrived in 1986, and "beans'n'rice" was still top of most menus. The beaches went on forever, and the fishermen still set out through the surfers, in long canoes. Amid all this our hotel felt thrillingly alien. Inside, everything was a soothing white, and it had a pool that glowed pink and green at night. It was called Le Caméléon (lecameleonhotel.com) but Lucy called it The Starship.
One day, we found a Bribri guide, Tirza, to take us round their reserve. Of a Costa Rican population of 4.5 million, there are only 63,000 indigenas, and these people are gradually finding their economic muscle. Tirza's father was a herbalist, and lived near the Panama border. Like Paulo, he loved receiving visitors, and had even built a little auditorium of twigs and thatch. Out came powerful cures, magic rocks, and even an old stone axe-head. He said he knew more than 1,500 plants, and there was nothing the forest couldn't cure.
As we were leaving, I asked Tirza if she thought tourism was good for the Bribri. "Of course," she said. "It keeps the narcos out."
A few miles on, we visited some basket-weavers in their stilted hut deep in the forest. Inside, an old man was swinging in his hammock, and everyone said he was 112. I bought one of family's baskets; it's an exquisite thing, made of grass, and just big enough to hold an egg. I noticed that, from the rafters, hung everything you'd need for a life in the forest: gourds, bows, arrows, and a long length of snakeskin. The weavers said they'd like to take us trekking, four days into the jungle.
"Next time," I said, genuinely hoping there'd be one.
Our last few days were spent in Cabécar territory. Unlike the Bribri, they are mountain people, and live in the upper reaches of the Pacuare river. To get there, we retraced our steps into the highlands, until we got to the river. Then, from there, I joined a rafting trip while Jayne and Lucy went on by jeep (you need to be 12 to go rafting).
What followed was enjoyable, in a slightly terrifying way. One minute our little dinghies would be sliding briskly through the gorges, and the next an abyss would appear in the middle of the river. Our guide had names for all these rapids: Pinball, Nose-breaker and The Chasm. For a moment, we'd skim around the hole before being sucked down into the froth, knocked about and then hurled out, down the river.
But the Pacuare was more than just a watery pummelling: it also led us to The Pacuare Lodge (pacuarelodge.com). It was an astonishing hotel, in a deep, narrow gorge. The building itself, on the site of an old Indian farm, was like a Cabécar stately home, with an enormous carapace of thatch. Lucy was enchanted. Wild pigs still came here foraging for fruit. More recently, the hotel's cameras had picked up ocelots and jaguars, an exhilarating thought when there's only gauze between your bed and the jungle. Lucy loved it. Each morning, we lay in our beds, listening to a distant roar. It was the howler monkeys, one of the loudest creatures on Earth.
The waiters were all naturalists, and some were Cabécars. One day, we walked to their village, Nairi Awairi, four miles over the mountains. Our guide kept Lucy going by pointing out endless oddities such as leaf-cutter ants: 3,000,000 females burning a motorway through the jungle, with their own natural weed killer. By contrast, the village seemed rather quaint, on the edge of a plateau. Only the shaman was at home, in a hut full of masks and arrows.
Back at the lodge, we took a dip in the river. Crocodiles may shun the upper Pacuare, but children love it: here's a swimming pool, bubbling down the stairs.
On our last day, Geraldo, an ex-hunter, took the girls zip-wiring in a complex cat's cradle of hawsers and platforms constructed 25m up in the canopy. For hours, Lucy and Geraldo squealed through the forest like a pair of conjoined bats.
We left Pacuare, as we'd arrived – in my case, by raft. This time, I had to do 18 miles of Chasms and Nose-breakers. It was, I suppose, a timely reminder of the realities of lush, tame, herbaceous Costa Rica. It's easy to imagine you've inadvertently wandered into the Garden of Eden. Well, if that happens, here's a river to beat some sense back into you, and send you home with a few souvenir bruises.
Getting there The trip was provided by Audley Travel (01993 838 638, audleytravel.com). An 11-day trip costs from £1,695pp based on two sharing, including flights, accommodation and shared transfers. Itineraries can be tailor-made to include the lodges mentioned in the article. United Airlines (united.com) flies Heathrow-San Jose, via Houston or Newark, from £695.
More information Atec, the Talamancan association of ecotourism and conservation (ateccr.org) is run by local indigenous people.
• John Gimlette is the winner of this year's Dolman Travel Book Prize with Wild Coast: Travels on South America's Untamed Edge (Profile, £8.99). To buy a copy for £7.19 including free UK p&p, go to guardianbookshop.co.uk