Let say the IMEI is presented as D14-D13-D12-…-D1-D0 (15 digits), where D0 is the check digit.
The last digit D0 is calculated as follow:
1. Double the values of the odd labelled digits D1, D3, D5 … D13.
2. Add together the individual digits of all the seven numbers obtained in step 1, and then add this sum to the sum of all the even labelled digits D2, D4, D6 … D14.
3. If the result obtained in step 2 ends with 0, then D0 = 0. If it does not end in 0, then D0 equals to the number subtracted from the next higher number which does end in 0.
If you familiar with VB, I can give you a procedure written in VB for calculation of this last digit.