A technique for computer simulation of three-dimensional structures of materials with reinforcing particles of complex irregular shapes observed in the experiments is proposed, which assumes scale invariance of the natural mechanical fragmentation. Two-phase structures of metal-matrix composites and coatings of different spatial scales are created, with the particles randomly distributed over the matrix and coating computational domains. Using the titanium carbide reinforcing particle embedded into the aluminum as an example, plastic strain localization and residual stress formation along the matrix-particle interface are numerically investigated during cooling followed by compression or tension of the composite. A detailed analysis is performed to evaluate the residual stress concentration in local regions of bulk tension formed under all-round and uniaxial compression of the composite due to the concave and convex interfacial asperities.