I got my current job because I did this; I interviewed for position A but didn't get it; by the time my thank-you letter arrived a week after being told the bad news, another job opened up and that interviewer was not only impressed by the letter but by interview and thought me a better fit for this newer job (it is!). She forwarded my resume to the new job's boss, who hired me during a interview later that day.
Long story short: do this. At worst, it can't hurt; at best, it can help you get your perfect job.