Were the boulder tossing rock giants(shown in the film) beings, or metaphors for the dangers(described in the book) of traveling the high mountain passes that Bilbo and company utilized on their journey to the Lonely Mountain?
They are Giants. They appear in the original book, though I'm not sure how accurate the movie depiction is, so they are not strictly metaphors but an actual event.
Elsewhere in the book, Gandalf mentions giants again in reference to the goblin tunnels.
"I must see if I can't find a more or less decent giant to block it up again," said Gandalf, "or soon there won't be getting over the mountains at all."
So giants are real beings. Whether they are the same beings that Bilbo and company encounter isn't clear though.
I tend to take the passage in the book literally: there were giants in Middle-earth, and they were out at play during the storm. Gandalf's later comment about "a more or less decent giant" supports this reading.
It may seem odd that this is the only appearance of giants in Tolkien's work, but it need not be so odd.
In earlier plot projections for Lord of the Rings Treebeard was explicitly intended to be a giant. These are covered in HoME 6 (Return of the Shadow) and I'll quote two extracts:
I was caught in Fangorn and spent many weary days as a prisoner of the Giant Treebeard.
In this one the capitalization is in the original, showing that it's intended to be read as a proper noun.
though there is no dragon (so far) there is going to be a Giant.
This passage is also present in Letter 35, and again the capitalization is in the original.
It's therefore clear that at least at this stage, Giants were viewed as a reality in Tolkien's world.
An interesting note attached to the development of the Treebeard chapter, and given in HoME 7 (Treason of Isengard) reads:
Difference between trolls - stone inhabited by goblin-spirit, stone-giants, and the 'tree-folk'.
This was roughly the point at which the concept of Ents emerged (there are other jottings about the Elves "making" them, and about tree-folk that have become tree-like), and the intention seems to have been that giants are still recognised as a distinct species.
In the finished work two possible readings exist:
I'm not currently aware of any other writing that has bearing on this topic.
I read the book several times, (long ago, I think it's about time to read it again). But all the times I read it as huge thunderstorm and landslides are happening, and the rock falls could be due to giant tossing giant stones on them. But with all the mess and noise from thunders and falling stones, low visibility and bad angle to look up, no one saw any giant, and even though Gandalf mentions giants, it does not guarantee they were there attacking the company.
I think that, in a world full of superstition, but without proof in this specific case, it is impossible to say.
PS: On a personal note, I would have liked it better if the movie used a subtler interpretation, like that given in the book. I also think it was some excuse for animation and computer effects.
In the source novel, their actions are described thusly;
When he peeped out in the lightning-flashes, he saw that across the valley the stone-giants were out and were hurling rocks at one another for a game, and catching them, and tossing them down into the darkness where they smashed among the trees far below, or splintered into little bits with a bang.
The film's commentary track (between Director Peter Jackson and Screenwriter Pippa Boyens) isn't any more enlightening than that. Commenting on why the giants are fighting...
PJ: Yeah, I always wondered why these giants dislike each other so much. It must be something very personal has gone on.
PB: Well, maybe it's in their nature.
Here I am 2 years after the last answer... I just personally think that it was Peter jackson's mental/feelings interpretation of that part of the book. When I read The Hobbit back in the 70s as a youngster, I saw the thunderstorm passage as a battle of sorts from other-worldly entities buffeting the group... I just didn't take it as far as Jackson with the actual animation of stone giants... I like it!!