First you have to install the base system like Raspbian or any other OS with full package support and writable partition - do not use OpenELEC, this cannot be customized.
I recommend Raspbian as it is closest to the native Debian distribution.
After the first boot your system will run "raspi-config". Select your options for keyboard, locales and timezone. I recommend to set the full size of the flash card as well. Also activate ssh to administer your device comfortably via an SSH client.
As you are on your console you enter the following command:
sudo apt-get update && sudo apt-get install mc cups samba samba-common-bin
This will install all needed modules. The package "mc" is for your convenience only.
To configure your CUPS I recommend this howto to setup a graphical web interface to configure your local printers that have to be connected via USB on the RPi: http://www.debianadmin.com/setup-cups-common-unix-printing-system-server-and-client-in-debian.html
After you setup your printer you shall open your samba server to your windows network by opening the /etc/samba/smb.conf file in an editor, e.g.
sudo nano /etc/samba/smb.conf
Search the following section and edit it to this result:
[printers]
comment = All Printers
browseable = yes
path = /tmp
printable = yes
public = no
writable = no
create mode = 0700
Save the file with CTRL-o and leave nano with CTRL-x.
Restart the samba server with
sudo /etc/init.d/samba restart
And you are done!
Open windows explorer and type the ip or hostname in the address field, e.g.
\\192.168.2.177
You should see the printer you added via CUPS web interface. Right click on it and choose "connect...". Follow the instructions to install the printer.
Notice: your RPi does not deliver any drivers for the printer so you might have to install them in windows yourself.