A velocity boundary condition for the lattice Boltzmann simulation technique has been proposed recently by Hecht and Harting (2008 arXiv:0811.4593). This boundary condition is independent of the relaxation process during collision and contains no artificial slip. In this work, this boundary condition is extended to simulate slip flows. The extended boundary condition has been tested and it is found that the slip length is independent of the shear rate and the density, and proportional to the BGK relaxation time. The method is used to study slip in Poiseuille flow and in linear shear flow. Patterned walls with stripes of different slip parameters are also studied, and an anisotropy of the slip length in accordance with the surface pattern is found. The angle dependence of the simulation results perfectly agrees with theoretical expectations. The results confirm that the proposed boundary conditions can be used for simulating slip flows in microfluidics using the single-relaxation-time lattice Boltzmann technique, without any numerical slip, giving an accuracy of second order.