Edit: I just saw John Rennie post his answer, but he seems to assume that all the heat flow $\delta Q$, which comes from the hot bath, translates to the $\delta Q$, which eventually heats up the cold gas via $\delta Q=C dT$. I'm interested in clearing that up.

I think this is the way to go:
We have the efficiency
$$\eta:=\frac{\delta W}{\delta Q_{\text{bath}}}=1-\frac{T_{\text{low}}}{T_{bath}},$$
and
$$\delta Q_{\text{low}}=C\ dT,$$
and of course
$$dU=\delta Q_{\text{bath}}-(\delta Q_{\text{low}}+\delta W)=0.$$
$$\Longrightarrow \left(\frac{\delta Q_{\text{bath}}}{\delta W}-1\right)\delta W=\delta Q_{\text{low}}$$
$$\Longrightarrow \delta W=C\ dT\times \left(\frac{T_{\text{bath}}}{T_{\text{low}}}-1\right)$$
If you use your machine it open up the heat channel and translates $\delta Q_{\text{bath}}$ to work as long as the initially cold gas hasn't warmed up to bath temperature. In case you start out with $T_{\text{low}}=T_{\text{bath}}$, then nothing will happen.
$$\Delta W=\int_{\epsilon>0}^{T_{\text{bath}}}C\ T_{bath}\left(\frac{1}{T}-\frac{1}{T_{bath}}\right)dT=C\ T_{\text{bath}}\times \left(\text{log}\left({\frac{T_{\text{bath}}}{\epsilon}}\right)-\frac{T_{\text{bath}}-\epsilon}{T_{\text{bath}}}\right).$$
Here the first factor $C\ T_{\text{bath}}$ would be the energy from the direct heating of the cold gas.
Edit: To point that out more clearly, the term $-C\ T_{\text{bath}}\ \text{log}(\epsilon)$ in this ideal model is arbitrary big. Whenever you half the small minimal temperature, you get another constant amount of work $W$ out of the machine.