I've used brewed coffee in place of sparge water before, i wouldn't recommend this though, it imparts that sour/acrid coffee flavor without much of the desired full roast bodied flavor
I've dry hopped whole beans and coarsely ground (pounded with a hammer actually) into the secondary and have very good luck with that for flavoring stouts and porters. The amount is of course up to you, but I would recommend going into a coffee shop and sampling several kinds of coffee and smelling the beans in order to choose the variety that you want in your brew