Is aqueous medium necessary for complex formation? if so, why? If dry ammonia gas is passed through anhydrous copper sulfate, will it turn blue (due to the formation of tetraamminecopper(II) complex)? Or will silver chloride form diamminesilver(I) complex in liquid ammonia?

If the above complexes do not get formed in non-aqueous mediums, why is it so?
It should be noted that ammonia is a mildly polar solvent and that (for instance) you can prepare $\ce{[Cu(NH3)6]^2+}$ by reaction with liquid ammonia1. The description of the geometry (two pages earlier) of $\ce{CuSO4.5H2O}$ (namely containing a square planar $\ce{[Cu(H2O)4]^2+}$ unit with two additional $\ce{[SO4]^2-}$ above and below the plane) suggests that ammine ligands could fulfill a similar role to water.

Bear in mind that passing ammonia gas over a solid will probably mean that if the reaction happens it will only happen near grain surfaces.

To answer your second suggestion, Housecroft and Sharpe1 identifies a reaction producing $\ce{[Ag(NH3)4]+}$ from $\ce{Ag2O}$ in liquid $\ce{NH3}$.

Hope this is informative.

[1] Housecroft, C. E.; Sharpe, A. G. Inorganic Chemistry, 2nd Edition; Pearson Prentice Hall, 2005; pp. 635–637, 693.