I am using Nikon D7000 with 18-105. I have read people saying to get images with the minimum depth of field, the lens should be at its maximumum focal length, in this case at 105mm. However at 105mm the aperture of the lens drops to f/5.6, so I don't understand why f/3.5 at 18 mm won't give me a shallower depth of field than 105 mm at f/5.6.
Focal length affects depth of field as well as aperture.
At f 3.5/18mm the depth of field is over 20 feet deep. Focusing on a subject 10 feet away this means that everything up to 17 feet behind the subject will be in focus.
At f 5.6/105mm the depth of field is 0.6 feet deep. This means only 0.3 feet (10cm) will be in focus behind the subject; in other words, the background will be blurred, and you will get bokeh.
Check out http://www.dofmaster.com/dofjs.html
Technically, at the same magnification of the subject and the same relative aperture (say, f/4) you have the same depth of field (as in depth of acceptable focus) although of course you will be much closer to the subject with the wider lens.
You'd have however different background blur due to the different magnification of the blurred background at different focal lengths. See here: http://toothwalker.org/optics/dof.html at the chapter titled "Background Blur".