Familiarize yourself with the basics of forensics. Check out some books that explain forensics in basic terms, such as "Forensics for Dummies" or "The Forensic Casebook." The techniques behind both basic and complex forensic investigation and detective work provide for fascinating fodder when it comes to plot details and can provide you with both inspiration and solid factual grounds for your fiction.
Create a premise. Come up with a crime scenario that's compelling either because of the way it happens, the people connected to it or a combination of both. Think about giving extra characters additional secrets, interesting life stories and relationships to one another, and look to plant a series of red herrings (suspected details or likely seeming culprits that turn out to be false).
Plot the crime itself. Before you start writing from the perspective of characters who are trying to solve the crime, make sure you know all the details of it yourself. This will allow you to plant small hints and decide how the guilty parties are behaving toward the protagonist(s).
Design a protagonist. Generally, the protagonist of a crime mystery story is the detective (whether institutional or informal and independent), though in some cases the hero is simply close to the detective and their investigation. Either way, be sure to give your hero (or heroes) an interesting personality and a personal journey that ties in with the investigation; give them a history and use your story to tell both the tale of the crime itself and the tale of how this investigation effects your hero.
Tell the story. Begin after or close to the crime itself and show the details from the point of view of the hero. Give your reader hints about the true nature of the mystery and strive for a balance between too obvious and too obscure; ideally, you want some of your readers to be able to solve the mystery based on your clues, but not make it too easy. To help with this process, employ beta-readers to help you judge how the mystery looks to someone unfamiliar with the story.