Start at the begining.
Decide exactly Who is doing What, How they are doing it and Why.
You need good solid answers to all of those before you can begin to get a plot together, unless its "the monsters live in the hole in the ground because thats where they live".
Once you have this you can put together the plan that Who is going to be following. The How and Why will give you how the What falls into a plan.
Take absolutely NO account of the PCs at this point. Plan "in character" as the Who, planning to succeed, but maybe putting in a few contingencies. (and playing a mean pinball

)
Once you have this you'll have a sort of timeline, in a very rough form, for what will happen without PC interraction.
Now shoe-horn in one (or, better, more) hooks. These are real plot hooks, not "the PCs hear about the hole in the ground full of monsters in the tavern" type plot hooks. They are the wrinkles in the Who's execution of the plan which give A; a shoe-in for the PCs to get going (i.e. they contribute a clue or lead) and B; provide the motivation for the PCs to care, by whatever means.
If you give yourself a nice spread of these hooks, you can re-use the ones that aren't needed as hooks for upping the ante, or to nudge the PCs along (each gives a lead or clue, you see, and also increases motivation...)
Right, the best trick, IMO, at this point is to plan a session where A; other stuff continues, or distracts and B; you feed in your hooks.
At the end of this session you should either know that all your hooks sucked (the players didn't care or didn't attach great significance to them) in which case you make more, better, hooks. This just makes the fore-shadowing seem all the more cunning once the plot is revealed, so no problem there.
Or you have your players hooked, and also have some idea of how they look likely to approach the problem. In the space between this session and the next you flesh out a little of where the intrigue is going (more hooks, but these are triggered by the players' investigations, not sprung on them), and put more detail into the areas that look like the players are going to probe into.
Be blunt; at the end of the sessions ask the players what they think is happening, and what they reckon they'll want to do next. Then invent bits to fit.
Remember throughout that your players don't know what you've prepped, so you are free to alter and revise on the fly..
2 cheesy tricks:
Making the players feel clever after they've worked hard is simple; just wait a while and then decide that one of the ideas they have kicked around becomes the truth (i.e. scrap your plan and go with theirs). Feeling like you solved the mystery by great intuition is fun
Surprising the players with a twist is equally simple; between the penultimate and ultimate sessions of the mystery, totally change the end plot. (keep things consistent) Make the useful contact have been leading them astray, add in a new revelation which makes this clear, then reveal the plot suddenly. If you make this decision late, you _cannot_ give away the game too early, works a treat!
You do need to put in fleshing out and revision effort in between every pair of sessions. If you think about it, there are few campaign threads which rely more heavily on player interraction and player direction than a mystery; they have to investigate, and for that to feel real to the players their methods of investigation have to be seen to affect the development of the investigation. You cannot have that if you've decided everything weeks in advance, you'll end up with the "single secret door" problem. You will also need to be capable of adding extra clues should yours prove beyond the players, or changing details of the plot if things look too easy. This does give you the option to tweak the difficulty to get that golden "we worked hard, but succeeded on our own merits" feeling for your players.
The "one secret door" problem is one where the whole dungeon resolves to "find and get through this door to finish" - if you don't find the door, the dungeon is impossible (many 1st ed. dungeons have this problem; presumably someone once throught tat was a good idea

)
For a mystery the problem of the solution resolving to "find or understand this SINGLE clue" is entirely analogous. If you plan it all ahead you WILL produce a linear plot, with a single crux.
If you plan as you go, reacting to the players' choices, you will also produce a linear plot, with a single crux

But that crux will be where the players are, so it won't FEEL linear to them!