An O(N) method is presented for calculation of hydrodynamic or electrostatic interactions between N point particles in a confined geometry. This approach splits point forces or sources into a local contribution for which rapidly decaying free-space analytical solutions to the Stokes or Poisson equations are used, and a global contribution whose effect is determined numerically using a fast iterative method. The scheme is applied to Brownian dynamics simulations of flowing confined polymer solutions, and the effects of concentration on hydrodynamically induced migration phenomena are illustrated.