The cave was hidden by bushes and its entrance was locked by a heavy stone door which could only be opened with a key.
After Tom, Bert, and William were turned to stone by the morning Sun, Thorin and Company followed the trolls' tracks up a hill and found their cave. At first they could not open it, but then Bilbo presented Gandalf with a large key that he'd found on the ground where the trolls had their fight, that had no doubt fallen out William's pocket. The key opened the door, and they went inside.
They found the cave's interior filthy, with bones on the floor and a nasty smell, but the cave was a treasure-trove that housed all the trolls' plunder, from brass buttons to pots full of gold coins. They found clothes of the trolls' victims, and several swords of various makes. Two of them had beautiful scabbards and jewelled hilts, and these turned out to be blades of Gondolin make: the elven-sword Glamdring, meaning "foe hammer" (called "Beater" by the orcs which once belonged to King Turgon), which Gandalf took, and Orcrist, meaning "goblin cleaver" (called "Biter" by the orcs), which Thorin took. Bilbo took a Gondolin knife in a leather sheath (the elven-blade he later named Sting).
More immediately useful to the group was food they found that appeared still untouched, including bread, cheese, and bacon, and a barrel of ale still full. They buried the pots of gold, putting spells over them in case they ever had the chance to come back to recover it them.