One example is related to tree decompositions and graphs of small treewidth.
Typically, if we are given a tree decomposition, it is fairly straightforward to apply dynamic programming to solve a given graph problem $B$ optimally. The running time depends on the width of the tree decomposition.
However, usually we are not given a tree decomposition, but we need to find it. To solve problem $B$ as fast as possible, we would like to find a tree decomposition of the smallest possible width – now this is our problem $A$.
We could try to solve problem $A$ exactly, but then we might waste too much time in part $A$. One possible approach is to use an approximation algorithm for part $A$. Then part $A$ is faster, at a cost of worse running time guarantees in part $B$.
Another example is related to compilers and register allocation. Assume that we have implemented an exact algorithm that solves a problem $B$ in polynomial time. The running time of the algorithm depends, in part, on how well the compiler managed to assign variables onto CPU registers – this is our problem $A$.
The solution of problem $B$ is correct even if the compiler uses an approximation algorithm to solve problem $A$; however, an approximation factor in problem $A$ affects the running time of algorithm $B$.