$Var[\bar{x}-\bar{y}] = Var[\bar{x}] + Var[\bar{y}] = \frac{\sigma_x^2}{n} + \frac{\sigma_y^2}{m}$
Now we assume that $x$ and $y$ come from populations with the same variance then $\sigma_y^2=\sigma_x^2=\sigma^2$.
The expression for variance becomes:
$Var[\bar{x}-\bar{y}] = \sigma^2 \left(\frac{1}{n} + \frac{1}{m}\right)$
Since we are assuming that X and Y have the same variance we can estimate $\sigma^2$ using the pooled variance. (Edit: As whuber mentions in his comment, using the pooled variance assumes that $\bar{X}$ and $\bar{Y}$ are independant and also that $\mu_x=\mu_y$)
$\sigma^2 = \frac{(n-1)s_x^2+(m-1)s_y^2}{n+m-2}$
And therefore:
$$Var[\bar{x}-\bar{y}] = \frac{(n-1)s_x^2+(m-1)s_y^2}{n+m-2}\left(\frac{1}{n} + \frac{1}{m}\right)$$