9mm or .38 special. I'm not of the school that says "buy a .22 first". There are several reasons for this.
1. Just about anyone can learn to handle either 9mm or .38 special. To me, they are basically the same - revolver / semi-auto, take your pick.
2. Either round is a decent self defense round. At least this way, you have a gun that you can use for self defense right out of the box.
3. 9mm ammo is cheap enough to where you can shoot tons of it and it won't break the bank.
4. If you are worried about learning not to flinch - stop worrying about it. You may or may not initially experience this problem. If you do, simply shoot more. You can still practice good technique with a real gun - you don't need a toy .22 to accomplish this.
5. I'd bet that most of the "experts" (and there are some genuine experts on this board) on this board fired a larger caliber than .22 the first time they shot a handgun.
6. If you find you are having problems hitting the target, then move the target closer. Figure out where you tend to group, and then work on correcting the problem. There are charts, instructors, books and self-appointed experts that can help you do this.
7. I have a Ruger Mark II .22. This was about the 6th or 7th handgun that I had purchased. I bought it because everyone said you really should get a good .22 to practice with. And, I did use this to practice for awhile. It did nothing to improve my accuracy or ability to shoot larger caliber handguns. But, it is fun to shoot every now and then - so, for me it's basically a range toy. Admittedly, I do use it to introduce kids who have never shot, or adults who are a bit timmid about shooting to shooting handguns.
Learning to shoot by using a .22 handgun first won't hurt anything. I'm not saying that it's "bad practice" to do this. I'm simply saying that it isn't necessary.