Time dependent chemistry in dense molecular clouds. I - Grain surface reactions, gas/grain interactions and infrared spectroscopy