Let's talk about what the opening passage of a book is supposed to do. The writer's number one job when writing a novel's first page is to establish for the reader that a good story is beginning and to assure him that the author has the ability to tell that story. The opening promises something interesting and intelligible (most times). It sets the tone, mood and style of the story, and gives the reader an idea of what she is in for.
We should look at the opening passages from some successful novels.
Here's the beginning of Lolita by Vladimir Nabokov:
Lolita, light of my life, fire of my loins. My sin, my soul. Lo-lee-ta: the tip of the tongue taking a trip of three steps down the palate to tap, at three, on the teeth. Lo. Lee. Ta.
She was plain Lo, in the morning, standing four feet ten in one sock. She was Lola in slacks. She was Dolly at school. She was Dolores on the dotted line. But in my arms she was always Lolita.
Did she have a precurser? She did, indeed she did. In point of fact, there might have been no Lolita at all had I not loved, one summer, a certain initial girl-child. In a princedom by the sea. Oh when? About as many years before Lolita was born as my age was that summer. You can always count on a murderer for a fancy prose style.
This passage is, on the surface, about a girl named Lolita. In reality, it is the egocentric narrator telling us about himself, which prefigures the tone and style of the whole book. Nabokov has begun as he means to continue. He has challenged the reader to a battle of wits and piqued our interest with that thrown-away reference to "a murderer."
Here's the opening of Leo Tolstoy's Anna Karenina:
All happy families are alike; each unhappy family is unhappy in its own way.
All was confusion in the Oblonskys' house. The wife had found out that the husband was having an affair with their former French governess, and had announced to the husband that she could not live in the same house with him. This situation had continued for three days now, and was painfully felt by the couple themselves, as well as by all the members of the family and household. They felt that there was no sense in their living together and that people who meet accidentally at any inn have more conncection with each other than they, the members of the family and household of the Oblonskys. The wife would not leave her rooms, the husband was away for the third day. The children were running all over the house as if lost; the English governess quarrelled with the housekeeper and wrote a note to a friend, asking her to find her a new place; the cook had already left the premises the day before, at dinner-time; the kitchen maid and the coachman had given notice.
The first line here is Tolstoy's "theme sentence," the claim that he will have to "prove" by the events he gives us in the book. We know already that we will see an account of a uniquely unhappy family.
You can say that what follows that first line is all "telling," but so what? The list of tensions, of battles in and defections from the household is delightfully energetic. Tolstoy has launched us headlong into the middle of a domestic war. We know that the situation can't last; something's got to give and it won't be pretty when it does.
Here's one you might already know:
In a hole in the ground there lived a hobbit. Not a nasty, dirty, wet hole, filled with the ends of worms and an oozy smell, nor yet a dry, bare, sandy hole with nothing in it to sit down on or to eat: it was a hobbit-hole, and that means comfort.
A lot of The Hobbit is about being underground, and we are first given a contrast between nice underground living and "nasty, dirty, wet." The nice versus the nasty is a constant element in this book, running all through the story. Even so seemingly tame a sentence as this contains conflict and mystery.
And finally, this is how Neil Gaiman opened his Newberry Prize-winning The Graveyard Book:
The knife had a handle of polished black bone, and a blade finer and sharper than any razor. If it sliced you, you might not even know you had been cut, not immediately.
The knife had done almost everything it was brought to that house to do, and both the blade and the handle were wet.
The street door was still open, just a little, where the knife and the man who held it had slipped in, and wisps of nighttime mist slithered and twined into the house through the open door.
Gaiman begins in medias res. Something horrible is happening. The focus on the knife, as if it is an intelligent agent, and the "not immediately" are sinister and disorienting: we want to know what is going on, as all this elliptical prose is creepy and we want to rule out our own worst fears as soon as possible. The language and tone here are calm, low-key to describe a horrible, violent murder.
It is my claim that all of these openings, which begin radically different books, accomplish the same thing, and do so without being over-the-top or in any way anything but careful and assured. All of these writers begin as they intend to go on. The openings are not prologues, and the action of the books flows directly from these opening passages. There are no tricks, there is no bait-and-switch, there is no huge event followed by a lot of dull backstory. The tales begin where they should, and move forward from there.
Each of the above openings promise that something interesting will happen and it will be told in an interesting way. Most good openings in modern fiction show something happening. This does not have to be something violent or sinister as in the Gaiman example; it just has to be something unexpected. It can be a minor moment of the unexpected, like Nabokov's announcement that the linguistically-playful narrator is a murderer.
I have noticed that some people are putting more emphasis on (and more work into) the first page of their novel than they put into the whole rest of the book. This is a Very Bad Thing, and I'm not exactly sure what's sparked this evil and misguided trend. I think a lot of it has to do with agent websites and online "first page/sentence/paragraph" contests that put too much weight on the opening of the book. Well, anything that makes a writer think more deeply about his own writing is a good thing, but there is a lot of bullshit advice out there. There is a lot of emphasis on "hooks." Everyone seems to be ignoring the very basic idea that we should just write a solid story well. If you write a good story and start the story in the right place and begin the story the way the story goes on rather than trying to do something special and fancy at the start, your opening should mostly take care of itself.
Ironically, therefore, my advice is to ignore the advice about beginnings that you'll get from most people on the internets; just look at real books that have been published and that you love and admire. But don't just mimic an opening you like; figure out why that opening works for that particular book! Your book is not a collage; it is not a pastiche of little techniques you've gathered together from other books. Your book is a single and unified whole that you have written yourself.*
There is no perfect opening gambit that will "hook" every reader, or even most readers. What looks like brilliance to me may be boring to you, and vice versa. Your opening page(s) will either attract, repel, or leave your reader indifferent. You have no control over that. So just write the best you can, always, no matter what page of your novel you're writing.
*Unless you're David Shields, that is.