Microscopic studies of fluids in pores: Computer simulation and mean-field theory