The study of viscoelastic properties has many industrial and academic applications related to "soft matter" like polymers, colloids, surfactants or proteins. The present approach measures these properties in a frequency range from 1 to 100 kHz. The method uses the measurement of the vibration of a microstructure actuated electromagnetically and immersed in the fluid that has to be characterized. The frequency response of the mechanical system, which is measured optically or electrically, is characteristic of the environment in which the structure is immersed in. An analytical method dedicated to microcantilevers for the extraction of the rheological properties has been improved during this PhD thesis. The analytical method developed requires the accuracy of a complex optical system for measuring without artifact the mechanical properties of microcantilever-liquid interaction. Thus opaque liquids cannot be characterized with this sytem. In addition, the measurement cannot easily be integrated. To overcome these difficulties and provide the measurement of viscoelasticity into opaque medium, some strategy was reassessed: (1) "U" shaped microstructures were fabricated; (2) an integrated measurement method was developed and (3) a single frequency method was used to calculate the viscoelasticity. Finally, a viscoelastic and opaque liquid, such as yogurt, has been characterized in situ during the lactic fermentation to demonstrate the validity and the applicability of the method for the real-time monitoring of viscoelasticity.