You can buy pre-made cables female to male and male to male on Electrodragon
40 pin Female to Male $2.30 W/single pin shellshttp://www.electrodragon.com/?product=prototype-cable-female-and-male-end-40p
40 wire cable W crimped connectors for .025 Sq pins $1.50 (No shellls on pins)http://www.electrodragon.com/?product=raw-dupont-cables-with-metal-insert-40p
and the shells for the pins form $0.24 / 50 pcs (single pin) 1, 2, 3, 4, 6 pin and the shells for the pins on the cable above.http://www.electrodragon.com/?product=dupont-prototype-jumper-cable-terminal-end-50-pcs
These are what I use to make "Custom" cables for different applications I have a full 40 pin Male to female connecting an Itead 3.2" LDC to a shield on a Mega, works well.