The modeling of thermal residual stresses generated in TaC/stellite and TiC/stellite composite surface layers produced by the oscillating electron beam remelting on low alloys steel is presented. The homogenization method is applied to analyze the real composite microstructures by utilizing the digital image-based (DIB) geometric modeling technique. Two scales of elastic stress analysis are studied: macroscopic one referring to the global structure of composite layer produced over the substrate of low alloy steel and microscopic, comprising the selected unit cell of composite microstructure. The results of the analysis show the microscopic stress to be few times higher than the macroscopic one with stress level much above the elastic limit of matrix material, which implies the development of plastic field around the inclusions. The ceramic inclusions within the unit cell are found to be under high compressive stresses. Also, the composite surface layer stays in compression, mainly by the influence of the stress component parallel to the layer/ substrate interface. The effect of hardphase volume fraction is examined and it is found that for a small volume fractions the macro and micro stress does not differ substantially between composites with TaC and TiC hardphases despite their mismatch in thermophysical properties. Also, the stress modeling is presented for the composite containing other inclusions and the problem of the selection between 2D and 3D model for the stress analysis is discussed.