X-ray magnetic circular dichroism(XMCD) spectra at the L2,3 edges of mixed-valence rare-earth compounds in high magnetic fields are studied both theoretically and experimentally. The theoretical study is based on a new framework proposed recently by Kotani. The Zeeman splitting of 4f states, the mixed-valence character of 4f states, and the 4f-5d exchange interaction are incorporated into a single impurity Anderson model. New XMCD experiments in high magnetic fields up to 40 T are carried out for the mixed-valence compounds EuNi2(Si0.18Ge0.82)2 and YbInCu 4 by using a miniature pulsed magnet, which was developed recently by Matsuda et al. The XMCD data are taken at 5 K by transmission measurements for incident X-rays with helicities at BL39XU in SPring-8. After giving a survey on recent developments in the theory of XMCD spectra for mixed-valence Ce and Yb compounds, we calculate the XMCD spectra of YbInCu4 at the field-induced valence transition around 32 T by applying the recent theoretical framework and by newly introducing at 32 T a discontinuous change in the Yb 4f level and that in the hybridization strength between the Yb 4f and conduction electrons. The calculated results are compared with the experimental ones.