I’ve done IMC 4 times now (i’m a student, so cheap is good).
The shittiest part about it is the minimum stay, and the inflated resort type rates. We found a place last year for $1300 for the week, kitchenette (saved on food costs), and split it 2 ways (2 beds).
Next year for IMCDA, i found a hotel at 70/night for the first night, and 50/night for the next 6.
Race fees + Hotel = $1000, vs. close to $2000 for IMC.
Food/etc - depends how much you eat/eat out, but if you get a kitchenette, it’s really no different than being at home for the week. Maybe some extra cash on snack type food for the bike.
Gas - I drove to IMC (just over 11 hours), and will drive to CDA. Long way, but significantly cheaper than flying. Maybe 200-300 in gas, depending.
For a continental race, I would budget at least 2000 or so, depending on where/how you stay, and who you split the costs with. Kona last year we found a place for $100/night, and split it 5 ways. Made the 14 days on the island cost about $300CDN. Flight wasn’t cheap, but all in all, i think it cost me the same as going to Canada - food being the biggest exception (hell of a lot more expensive on the island, even with a kitchenette).
I had a friend do brasil through a travel company last year…apparently based out of eastern canada, but i’m not 100%sure. he’s a med student, so I think it was reasonably cheap, but he’s also run out of student loans, so i’m not sure exactly how cheap… 
if you’re willing to not stay at the ritz while you’re at a race, or willing, at IMC for example, to stay somewhere not right downtown in the action, there are reasonable prices everywhere. At Kona, we were 6 miles away for 100/night, vs. at the start line for $400/night…your call.