*State-space Models with Regime Switching*, 1999, MIT Press. The book demonstrates estimation of state-space models with Markov switching using both approximate maximum likelihood using the "Kim" filter and MCMC methods. In both cases, it starts with simpler models and works up, so the examples through kimnp126.rpf are for maximum likelihood and those starting with kimnp180.rpf are for MCMC.

Quite a few of these examples (switching space-space models and some of the simpler examples) are explained in much greater detail in the "Structural Breaks and Switching Models" e-course.