Here is a tutorial on how to make candy sprinkles in Photoshop.
1. Open up a new canvas, 300 x 300.
2. Select your color and set it as the foreground color, then use the Rounded Rectangle tool to draw a rectangle that spans the canvas from top to bottom.
3. Go to layer styles (Layer > Layer Style) and apply the Inner Shadow, Inner Glow, Bevel and Emboss, Contour and Satin styles.
Bevel and Emboss
4. Next, go to the warp transform.
5. Go to the square (node) in at the upper right of the rounded rectangle and drag the node down.
6. Repeat for the node in the upper left of the rounded rectangle.
7. Go to the node at the bottom right of the rounded rectangle and drag the node up.
8. Repeat for the node in the bottom left of the rounded rectangle.
9. Press the Return or Enter key to commit to the warp.
The sprinkle is now complete. For a cookie, make several sprinkles, rotate them, resize and then paste onto the cookie.