The experimental and numerical techniques for evaluation of mechanical properties of highly inhomogeneous materials are discussed. The techniques are applied to coal as an example of such a material. Characterization of coals is a very difficult task because they are composed of a number of distinct organic entities called macerals and some amount of inorganic substances along with internal pores and cracks. It is argued that to avoid the influence of the pores and cracks, the samples of the materials have to be prepared as very thin and very smooth sections, and the depth-sensing nanoindentation (DSNI) techniques has to be employed rather than the conventional microindentation. It is shown that the use of the modern nanoindentation techniques integrated with transmitted light microscopy is very effective for evaluation of elastic modulus and hardness of coal macerals. However, because the thin sections are glued to the substrate and the glue thickness is approximately equal to the thickness of the section, the conventional DSNI techniques show the effective properties of the section/substrate system rather than the properties of the material. As the first approximation, it is proposed to describe the sample/substrate system using the classic exponential weight function for the dependence of the equivalent elastic contact modulus on the depth of indentation. This simple approach allows us to extract the contact modulus of the material constitutes from the data measured on a region occupied by a specific component of the material. The proposed approach is demonstrated on application to the experimental data obtained by Berkovich nanoindentation with varying maximum depth of indentation.