A hybrid boundary integral/slender body algorithm for modelling flagellar cell motility is presented. The algorithm uses the boundary element method to represent the 'wedge-shaped' head of the human sperm cell and a slender body theory representation of the flagellum. The head morphology is specified carefully due to its significant effect on the force and torque balance and hence movement of the free-swimming cell. The technique is used to investigate the mechanisms for the accumulation of human spermatozoa near surfaces. Sperm swimming in an infinite fluid, and near a plane boundary, with prescribed planar and three-dimensional flagellar waveforms are simulated. Both planar and 'elliptical helicoid' beating cells are predicted to accumulate at distances of approximately 8.5-22 mu m from surfaces, for flagellar beating with angular wavenumber of 3 pi to 4 pi Planar beating cells with wavenumber of approximately 2.4 pi or greater are predicted to accumulate at a finite distance, while cells with wavenumber of approximately 2 pi or less are predicted to escape from the surface, likely due to the breakdown of the stable swimming configuration. In the stable swimming trajectory the cell has a small angle of inclination away from the surface, no greater than approximately 0.5 degrees. The trapping effect need not depend on specialized non-planar components of the flagellar beat but rather is a consequence of force and torque balance and the physical effect of the image systems in a no-slip plane boundary. The effect is relatively weak, so that a cell initially one body length from the surface and inclined at an angle of 4 degrees-6 degrees towards the surface will not be trapped but will rather be deflected from the surface. Cells performing rolling motility, where the flagellum sweeps Out a 'conical envelope', are predicted to align with the surface provided that they approach with sufficiently steep angle. However simulation of cells swimming against a Surface in such a configuration is not possible in the present framework. Simulated human sperm cells performing a planar beat with inclination between the beat plane and the plane-of-flattening of the head were not predicted to glide along surfaces, as has been observed in mouse sperm. Instead, cells initially with the head approximately 1.5-3 mu m from the surface were predicted to turn away and escape. The simulation model was also used to examine rolling motility due to elliptical helicoid flagellar beating. The head was found to rotate by approximately 240 degrees over one beat cycle and due to the time-varying torques associated with the flagellar beat was found to exhibit 'looping' as has been observed in cells swimming against coverslips.