  While the behavior of the dominant component of the dark matter is reasonably
well established by cosmological observables, its particle nature and
interactions with the rest of the matter are not known. We consider three dark
matter models that admit electromagnetic interaction between baryons and dark
matter: (a) milli-charged particle (CCDM) of charge $q_{\rm ccdm}$ and mass
$m_{\rm ccdm}$, (b) a neutral atom of two charged particles of mass $m_{\rm
dd}$ (DD), and (c) a neutral atom of doubly charged particle and helium nucleus
(HeD). We derive and discuss in detail the formation, stability, and
interaction of these atoms with baryons. We derive the implications of this new
interaction in the tight-coupling approximation, which allows us to
analytically gauge their impact on the matter power spectrum and CMB
anisotropy. We incorporate this new interaction into the publicly-available
code CLASS to obtain numerical results. We compare our results with Planck 2018
data to constrain the fraction of interacting dark matter. For the range of
allowed astrophysical parameters, the HeD atom yields the results of
$\Lambda$CDM model for $k < 1 \, \rm Mpc^{-1}$, and hence its fraction is not
constrained by CMB anisotropy data which is sensitive to $k < 0.2 \, \rm
Mpc^{-1}$. For $m_{\rm dd} \gtrsim 25 \, \rm GeV$, the DD atom is also not
constrained by CMB data. For $m_{\rm dd} = 10 \, \rm GeV$, the CMB data
constrains the fraction of DD atoms to be smaller than 4% of the total CDM
component. For $q_{\rm ccdm} = 10^{-6}e$ and $m_{\rm ccdm} = 50 \, \rm MeV$,
the CCDM fraction is constrained to be less than 1%.
