How to find the molar mass of an unknown metal carbonate through a gas evolution reaction?
$$\ce{HCl + M2CO3 -&gt; MCl + CO2 + H2O}$$


Since you already figured out, that there is a one-to-one ratio of carbonate to carbon dioxide, you can simply write
$$n(\ce{CO2}) = n(\ce{M2CO3}).$$

With the formula for the Molar mass,
$$M(\ce{M2CO3}) = \frac{m(\ce{M2CO3})}{n(\ce{M2CO3})},$$
you can simply substitute one for the other, hence
$$M(\ce{M2CO3}) = \frac{m(\ce{M2CO3})}{n(\ce{CO2})}.$$