Emulating a USB Standard Downstream Port Charging application
As noted in this Maxim whitepaper (Tutorial 4803: The Basics of USB Battery Charging: A Survival Guide):

Battery Charging Specification, Rev 1.1, 4/15/2009 (BC1.1) goes beyond the power distribution described in USB 2.0 by defining additional power sources for charging. It defines three different source types:
Standard downstream port (SDP) This is the same port defined by the USB 2.0 spec and is the typical form found in desktop and laptop computers. The maximum load current is 2.5mA when suspended, 100mA when connected and not suspended, and 500mA (max) when configured for that current. A device can recognize a SDP with hardware by detecting that the USB data lines, D+ and D-, are separately grounded through 15kΩ, but it still needs to enumerate to be USB compliant. In USB 2.0, it is not strictly legal to draw power without enumerating, although much of present-day hardware does just that, and in violation of the spec.
Charging downstream port (CDP) BC1.1 defines this new, higher current USB port for PCs, laptops, and other hardware. Now the CDP can supply up to 1.5A, which is a departure from USB 2.0 because this current can be supplied before enumeration. A device plugged into a CDP can recognize it as such by means of a hardware handshake implemented by manipulating and monitoring the D+ and D- lines. (See USB Battery Charging Specification, section 3.2.3.) The hardware test takes place before turning the data lines over to the USB transceiver, thus allowing a CDP to be detected (and charging to begin) before enumeration.
Dedicated charging port (DCP) BC1.1 describes power sources like wall warts and auto adapters that do not enumerate so that charging can occur with no digital communication at all. DCPs can supply up to 1.5A and are identified by a short between D+ to D-. This allows the creation of DCP &quot;wall warts&quot; that feature a USB mini or micro receptacle instead of a permanently attached wire with a barrel or customized connector. Such adapters allow any USB cable (with the correct plugs) to be used for charging.
Additional details on these port types are described in the USB Battery Charging Specification, Rev 1.1, 4/15/2009.

Some devices do not use the standard. Apple for one, created a different standard (before BC 1.1 was released) for their own devices, allowing them to distinguish between non-supported chargers, 500mA standard chargers (enumerated usb), 1A high current chargers, and 2.1A highest current chargers. This is done with varying voltage dividers on the DP and DM pins. Some other manufacturers have adopted that, and the regular standard, at the same time. Some IC manufacturers have created USB host/battery charger detection ICs which figure out what kind of charger is being used and adapt accordingly.

iPhones are one type of device that will not charge on an unenumerated standard downstream port. The Sony Playstation3 Wave Controller is another. Another method is that some require the ID pin on the mini/micro-usb connector to be grounded or otherwise connected.
You have two options if you need to limit to 500mA. 1, if the device requires enumeration, you will need to enumerate. 2, use a usb charging/host ic that can current limit (or a current limiting regulator or a current limiting ic)