You need to buy the right printer.
Disclaimer, I have not tried this out. All is based on what I have read online.
For example HP D110.
HP D110 Info Page
See Page 31 of User Guide...
HP D110 User's Manual
Here is how to set up an ad hoc network form there instruction manual.
1. In the Control Panel, double-click Network and Internet, then Network and
Sharing Center..
2. In the Network and Sharing Center (under Tasks on the left), select Set up a
connection or network.
3. Choose the connection option Set up a wireless ad hoc (computer-to-computer)
network, then click Next. Read the description and warnings about ad hoc networks,
then click Next>.
4. Enter details, including Network name (the SSID for your ad hoc connection),
Security type, and SecurityPassphrase. If you are going to save this network
connection, check Save this network. Make a note of the SSID and the Security key/
Passphrase for future reference. Click Next
5. Continue to follow the prompts to complete setup of the ad hoc network connection.