i've never heard of using a dead goldfish (most people who cycle in that manner use a cocktail shrimp from the store). There's no reason it shouldn't work tho.
The wait period depends, but ur probably looking at 3-4 weeks. You'll see the ammonia spike and receed, then the nitrites will do the same. When ammo and nitrites are zero'd out, do a 25% water change and ur off and running.