While waiting for answers regarding Andorra and Monaco, you might be interested in /u/alexistheman's answer regarding how San Marino survived during that time period.
There is also this FAQ should you want more comprehensive answers.