For a modern iOS XX version skip the answer as it has zero relevance lately.
Still here?
In iOS 3. You can't. But you know… people are landing here because of rank, and comments containing other versions and stuff so…
The fifth iOS release now allows a documented way of doing this: with the property onTintColor
.
UISwitch *s = [[UISwitch alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
s.on = YES;
s.onTintColor = [UIColor redColor];
[self.view addSubview:s];
[s release];
produce this

Edit: I have no idea why someone would come through and roll back the answer to limit it to the question only while not doing the same to all the answers.
Edit more:
In iOS 3 you had to use some undocumented feature. There used to be a link about that here but it broke. And if you did that your app might get rejected because of changing the color.
It kind of starts with this, which should be enough for you to find it somewhere else:
UISwitch *aSwitch = [[UISwitch alloc] initWithFrame:someRectangle];
[aSwitch setAlternateColors:YES];
//Do something with aSwitch
[aSwitch release];
I can't recommend it. And that turns out unpopular.