If you do not intend running any tasks in the background while doing the acc/deceleration, the following idea may work

Code:
Rate = ((Max-Min) *1000)/ Time   ' the 1000 is since I assume a mS time base
Here the Time variable is specified in seconds.

Now, using a 1mS time base, you can do this

Code:
for x = 0 to rate
   Output = Output + Rate  ' increase the output by a fraction we calculated
   pause 1           ' this is the 1mS time base I talked of
next
Rate could be -ve to decelerate.