What technique best infuses spices into a dish?
The classic technique for most spices is to roast them. This can be done in a dry pan because the spices cotain their own oils, you just need to make sure that they don't burn. The spices are usually used in the dish from the start so that they have time to infuse, but it is not always the case, for instance there are many dishes which add Garam Masala spice mix towards the end of the cooking although the spices have again usually been roasted before they are used. 

Regarding grinding them, again it does vary. Some spices are added whole but will then have to be removed before eating, some spice mixes are ground so they are eaten with the dish. All spices as far as I am aware should be roasted whole though so you would usually roast them and then grind them to produce the spice mix.