Let the square span from $-s$ to $s$ on each axis, so a small circle (radius $1$, tangent to two sides) is centered at $(s-1,s-1)$, exactly on the diagonal through that corner.
External tangency with the big circle (radius $3$ at the origin) means the distance between centers equals $1+3=4$: $(s-1)\sqrt2=4$, so $s=1+2\sqrt2$.
The diagonal of the square is $2s\sqrt2=2\sqrt2+8$.
Area $=\dfrac12(\text{diagonal})^2=\dfrac12(2\sqrt2+8)^2=\dfrac12(8+32\sqrt2+64)=\dfrac12(72+32\sqrt2)=\boxed{36+16\sqrt2}$.