With the scanner plugged in, run the lsusb command. You'll get several lines like this:
Bus 001 002 Device 002003: ID 046d03f0:c00e Logitech, Inc. Optical Mouse5d11 Hewlett-Packard Photosmart C5200 series
Look for the one that looks like it's for your scanneror printer (if the scanner is built in, as is the case above for the all-in-one printer+scanner from HP), and write down the two numbers next to ID (in this case, if the mouse was actually a scanner, 046d 03f0 and c00e5d11). The left number is the vendor ID, and the right is the product ID. Another option is to look here: http://www.linux-usb.org/usb.ids for your manufacturer and product.
AS ROOT, create a file called 15-scanner.rules in the /etc/udev/rules.d/ directory that contains exactly one line: