Dont cheat and use extracts! (just kidding Beernik) I do it the old fashion way and have had great results. I just don't want to use extracts because they are processed and not 100% pure.
You can add nut flavors two ways. In secondary or in the mash (some even whirlpool). I find raw nuts that I want to use and roast them in the oven at 350* for 10 minutes on sheets of brown paper (cut pieces from paper bags). After 10 minutes I remove them from the oven and squeeze them on paper towels, then put a new sheet of brown paper down and toast for another 10 minutes, repeating the paper towel squeezing at the end. Do this until you are happy with the roast and taste. This removes some of the oils that all nuts have and also helps bring out more flavors. These oils can ruin your head retention so make sure you account for this with your grain bill. I typically throw in some wheat or oats to counter this.
I have found that its better to crush the nuts then roast them if you want more surface area or you can just leave them whole, its really up to you. I like adding mine to the mash as I feel that this really helped out with filtering out any left over oils as they want to stick to the top of the mash.
A lot of commercial breweries just use raw nuts and add them directly to secondary. I like this as well but I personally like to roast all my nuts prior to using as I feel you can better flavors out of them (I guess it really depends on the nut). Anyways, this is how I do it and its the only way I would do it at our scale. In commercial environments it could be very expensive to do it this way so thats why some use extracts. Maui Brewing makes a great macadamia nut porter where they add the nuts to secondary.