Ab initio computational methods for electronic transport in nanoscaled systems are an invaluable tool for the design of quantum devices. We have developed a flexible and efficient algorithm for evaluating I-V characteristics of atomic junctions, which integrates the non-equilibrium Green's function method with density functional theory. This is currently implemented in the package Smeagol. The heart of Smeagol is our novel scheme for constructing the surface Green's functions describing the current/voltage probes. It consists of a direct summation of both open and closed scattering channels together with a regularization procedure of the Hamiltonian, and provides great improvements over standard recursive methods. In particular it allows us to tackle material systems with complicated electronic structures, such as magnetic transition metals. Here we present a detailed description of Smeagol together with an extensive range of applications relevant for the two burgeoning fields of spin and molecular-electronics.