I've just had a similar experience, and although I only muddled through, I might be able to help.
From what I can think, you need to use an "Execute SQL Task". Look at the "Parameters" button in there, and you get the option of using global variables as your input or output.
Create a global variable (look in the package properties) and don't worry too much about the data type - I wanted to use a date, but it would only accept a string, but seemed to work anyway (!)
Use your Execute SQL task to run the "lookup a value in a db" (and set the global variable) and then choose a workflow of onSuccess to do the data transform task, using a query, and using the global variable where needed.
I'm sorry if this is impossible to understand, but I hope it gets you started. I know exactly what you mean about the examples - there aren't any, and it's really difficult just to know where to start.