|"actually there are two other partitions: one 100MB and another one 15GB but they do not matter for me"|
The 100MB is the Win7 hidden boot partition & the 15GB partition is most likely the recovery partition. Keep them. You said you have a 500GB HDD. Formated, it's approx 465GB. Subtract the 15GB & you still have 450GB to work with. Why would you want a small 40GB partition for Win7? Give it some breathing room, at least 100GB.
If you're having problems partitioning, try using EaseUS Partition Master Home Edition. And pay attention to the partition type. You can only have 4 primary partitions.